﻿using System;

namespace Netkk.Common.Models
{
    public class User
    {
        public Guid Id { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public string Email { get; set; }
        public string Image { get; set; }
        public string Website { get; set; }
        public string Description { get; set; }
        public UserRole Role { get; set; }
        public string Name { get; set; }
        public string Password { get; set; }
        public bool IsValid { get; set; }
        public bool AllowShowProfile { get; set; }
        public bool AllowSendNewsletter { get; set; }
        public bool AllowSendEmails { get; set; }
        public string SortName
        {
            get { return ToString(); }
        }

        public override string ToString()
        {
            if (!String.IsNullOrEmpty(FirstName) || !String.IsNullOrEmpty(LastName))
            {
                return String.Format("{0} {1}", FirstName, LastName);
            }
            return Name;
        }
    }
}
